package com.liangwj.springbootdesignpatterns.structureTypePatterns.composite.demo_2;

import java.math.BigDecimal;

/**
 * <b>Description:</b> 叶子节点类:被上级的树枝节点管理 <br/>
 * 这里叶子节点没有什么权力，只能创建自己和看看自己的信息
 * @author Lingwenjun
 * @date 2019/1/28-16:15
 * @version 1.0
 */
public class Employee extends Company{

    public Employee(String name, String sex, String position, BigDecimal salary) {
        this.name = name;
        this.sex = sex;
        this.position = position;
        this.salary = salary;
    }

    //叶子节点本身的属性
    @Override
    public String getInfo() {
        StringBuilder sb = new StringBuilder();
        sb.append("下属 : ");
        sb.append("名称:");
        sb.append(name);
        sb.append(", 性别:");
        sb.append(sex);
        sb.append(", 职位:");
        sb.append(position);
        sb.append(", 薪水:");
        sb.append(salary);
        return sb.toString();
    }
}
